package com.panopset.gui;

/**
 * Integer properties file value editor.
 *
 * @author Karl Dinwiddie
 *
 */
public class PropvalEditorInteger extends PropvalEditor {

    /**
     * @param propertiesFileName Properties file name.
     */
    public PropvalEditorInteger(final String propertiesFileName) {
        this(null, propertiesFileName);
    }

    /**
     * @param defaultResourcePath Default resource path.
     * @param propertiesFileName Properties file name.
     */
    public PropvalEditorInteger(final String defaultResourcePath,
            final String propertiesFileName) {
        super(defaultResourcePath, propertiesFileName);
    }

    @Override
    protected final boolean validate(final String s) {
        try {
            Integer.parseInt(s);
            return true;
        } catch (final NumberFormatException ex) {
            return false;
        }
    }

}
